<div class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" id=x-upload-model-<!--{$data.number}--> >
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">图片预览</h3>
    </div>
    <div class="modal-body">
        <p><img id=x-upload-preview-image-<!--{$data.number}-->></p>
    </div>
    <div class="modal-footer hidden">
        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
        <button class="btn btn-primary">Save changes</button>
    </div>
</div>
<!--优雅的分隔线-->
<div class="input-append">
    <form enctype="multipart/form-data" method="post" id="x-upload-form-<!--{$data.number}-->" name="x-upload-form-<!--{$data.number}-->" target="_x-upload-target-paniel-<!--{$data.number}-->" action="<!--{Route->MakeHyperLink Controller=':common_upload::execute'}-->" style="padding:0px;margin:0px;width: 350px;position:relative;">
        <input id=x-upload-name-paniel-<!--{$data.number}--> name=x-upload-name-paniel-<!--{$data.number}--> type="text" id="cover" readonly="readonly" disabled="disabled" style="z-index:3;width:273px;"/>
        <button id=x-upload-button-browser-<!--{$data.number}--> name=x-upload-button-browser-<!--{$data.number}--> type="button" class="btn" style="z-index:1;width: 60px;">浏览</button>
        <button id=x-upload-button-upload-<!--{$data.number}--> name=x-upload-button-upload-<!--{$data.number}--> class="btn hidden" type="submit" style="width: 60px;">上传</button>
        <button id=x-upload-button-preview-<!--{$data.number}--> name=x-upload-button-preview-<!--{$data.number}--> style="border: 0px; background-color: #FFFFFF;padding-top: 8px;"><i class="icon-picture" ></i></button>
        <input type="file" id=x-upload-file-<!--{$data.number}--> name=x-upload-file-<!--{$data.number}--> id="x-upload-file" style="border:1px solid rgb(255,0,0);border-image:none;top:0px;font-size:100px;position:absolute;cursor:pointer;right:0px;overflow:hidden;z-index:1;opacity:0;-moz-opacity: 0;filter:alpha(opacity = 0);" />
        <input type="hidden" id=x-upload-data-<!--{$data.number}--> name="x-upload-data" value=<!--{$data.sourceControlId}-->,<!--{$data.errorPanelId}-->,x-upload-file-<!--{$data.number}-->,x-upload-name-paniel-<!--{$data.number}-->,<!--{$data.type}-->,<!--{$data.path}-->>
        <script type="text/javascript">
            var data=$('#x-upload-data-<!--{$data.number}-->').val().split(',');
            var sourceControl=$('#'+data[0]);
            if(sourceControl.val()===''){
                $('#x-upload-button-preview-<!--{$data.number}-->').hide();
            }
            else{
                $path=data[5].replace(/\\/,'/');
                $('#x-upload-preview-image-<!--{$data.number}-->').attr('src','<!--{$smarty.const.BUILD_PATH}-->'+$path+'/'+sourceControl.val());
            }
            //~
            $('#x-upload-file-<!--{$data.number}-->').change(function(){
                var filename=$(this).val().split('\\');
                if(filename.length===1){
                    filename=$(this).val().split('/');
                }
                filename=filename[filename.length-1];
                $('#x-upload-name-paniel-<!--{$data.number}-->').val(filename);
                $('#x-upload-form-<!--{$data.number}-->').submit();
            });
            //~
            $('#x-upload-button-preview-<!--{$data.number}-->').click(function(){
                $('#x-upload-model-<!--{$data.number}-->').modal().css({
                    'margin-top': function () {
                        return -($(this).height());
                    }
                });
                $('#x-upload-model-<!--{$data.number}-->').modal('show');
                return false;
            });
        </script>
    </form>
    <iframe class="hidden" id=_x-upload-target-paniel-<!--{$data.number}--> name=_x-upload-target-paniel-<!--{$data.number}-->></iframe>
</div>